package com.shd.edanpei.customer.bean;

import com.shd.edanpei.common.Constant;

/**
 * Created by mc on 2018/5/18.
 */

public class PayInfoModel {

    private int loanAmount;
    private int lastAmount;//终审金额
    private int orderType;
    private String repayTerm;
    private double depositAmount;
    private long depositPoints;
    private double serviceAmount;
    private long servicePoints;
    private long userPoints;


    public String getLoanAmount() {
        return loanAmount + Constant.Unit.WANYUAN.getUnit();
    }


    public int getOrderType() {
        return orderType;
    }

    public void setOrderType(int orderType) {
        this.orderType = orderType;
    }

    public String getRepayTerm() {
        return "期限：" + repayTerm;
    }

    public String getPayAmount() {
        return depositAmount + Constant.Unit.YUAN.getUnit();
    }


    public String getHint(int type) {
        if (type == Constant.PayType.deposit.getType()) {
            return "当前积分" + userPoints + "，本次需要积分" + depositPoints + (userPoints < depositPoints ? "，积分不足" : "");
        } else {
            return "当前积分" + userPoints + "，本次需要积分" + servicePoints + (userPoints < servicePoints ? "，积分不足" : "");
        }
    }

    //积分是否足够支付
    public boolean ifCanIntegralPay(int type) {
        if (type == Constant.PayType.deposit.getType()) {
            return userPoints >= depositPoints ? true : false;
        } else {
            return userPoints >= servicePoints ? true : false;
        }
    }

}
